﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace BWindingMachine
{
    public class ClassListViewOperate
    {
        public ClassListViewOperate()
        {
        }

        private static void AddNewItem(ref ListView listView, Queue queue)
        {
            int cnt = queue.Count;
            ListViewItem item = new ListViewItem();
            for (int i = 0; i < cnt; i++)
            {
                string str = queue.Dequeue().ToString();
                if (i == 0)
                {
                    item.SubItems[0].Text = str;  
                }
                else
                {
                    item.SubItems.Add(str);
                }
            }
            listView.Items.Add(item);
        }

        public static void AddOneRow(ref ListView listView, Queue queue)
        {
            AddNewItem(ref listView, queue);
        }
    }
}
